﻿
Partial Class LinqSample
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(sender As Object, e As EventArgs) Handles Me.Load
        Dim nombres As List(Of String) = New List(Of String)
        nombres.Add("Juan")
        nombres.Add("Maria")
        nombres.Add("Pedro")
        nombres.Add("Maria Fer")
        nombres.Add("Juan Luis")

        Dim res = New List(Of String)
        For Each item In nombres
            If (item.Contains("Maria")) Then
                res.Add(item)
            End If
        Next


        Dim query = From cc In nombres
                      Where cc.Contains("Maria")
                      Select cc


        Dim path As String = "<domain> <domainAtt> A </domainAtt> </domain>"

            


        Dim q = From d In XElement.Parse(path).Elements("domainAtt")
                Where d.Value = "A"
                Select d


        Dim aa = New XElement("Root", "Demo")
        aa.AddFirst(New XElement("Primer", New XAttribute("Data", "Ahora")))

        Me.TextBox1.Text = aa.ToString()







        Dim ct = New LSDynamicModelDataContext

        Dim qs = From c In ct.DomainAttributes
                  Where c.DomainId = "Customer"
                  Select c

        Me.GridView1.DataSource = qs
        Me.GridView1.DataBind()










    End Sub
End Class
